const getMysql = require('../mysql')

const swiper = async(req, res) => {
    let sql = 'select * from swiper'
    // console.log(req.sessionStore.codeId);
    getMysql(sql).then(result => {
        res.send({
            code: 200,
            message: '查询成功！！',
            data:result
        })
    }).catch(err => {
        console.log(err);
        res.send({
            code: 201,
            message: '查询失败'
        })
    })
}

const swiperBig = async(req, res) => {
    let id = req.query.id
    let sql = 'select * from swiper where id = ?'
    getMysql(sql,id).then(result => {
        res.send({
            code: 200,
            message: '查询成功！！',
            data:result
        })
    }).catch(err => {
        console.log(err);
        res.send({
            code: 201,
            message: '查询失败'
        })
    })
}



module.exports = {
    swiper,
    swiperBig
}